#include <bits/stdc++.h>
using namespace std;
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
using ll = long long;
ll row[11],col[11];
	ll l,n;
	ll ans=0;
void dfs(ll x,ll y)
{
	if(x==n&&y>n)
	{
		for(ll i=1;i<=n;++i) {
			if(row[i]!=l) return ;
		}
		for(ll i=1;i<=n;++i) {
			if(col[i]!=l) return ;
		}
		++ans;
		return ;
	}
	
	if(y==n+1)
	{
		x=x+1;
		y=1;
	}
	
	for(ll i=0;row[x]+i<=l&&col[y]+i<=l;i++)
	{
		row[x]+=i;
		col[y]+=i;
		dfs(x,y+1);
		row[x]-=i;
		col[y]-=i;
	}
}
void solve()
{

	cin >>  l >> n;
	dfs(1,1);
	cout<<ans;
}
int main()
{
    int t = 1;
    //cin >> t;
    while(t--)
    {
        solve();
    }
   return 0;
}
